-
Notifications
You must be signed in to change notification settings - Fork 0
get all voltage level connections #277
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Etienne LESOT <[email protected]>
Signed-off-by: Etienne LESOT <[email protected]>
Signed-off-by: Etienne LESOT <[email protected]>
Signed-off-by: Etienne LESOT <[email protected]>
Signed-off-by: Etienne LESOT <[email protected]>
Signed-off-by: Etienne LESOT <[email protected]>
Signed-off-by: Etienne LESOT <[email protected]>
Signed-off-by: Etienne LESOT <[email protected]>
Signed-off-by: Etienne LESOT <[email protected]>
Signed-off-by: Etienne LESOT <[email protected]>
Signed-off-by: Etienne LESOT <[email protected]>
Signed-off-by: Etienne LESOT <[email protected]>
Signed-off-by: Etienne LESOT <[email protected]>
Signed-off-by: Etienne LESOT <[email protected]>
src/main/java/org/gridsuite/network/map/dto/definition/voltagelevel/FeederBayInfos.java
Outdated
Show resolved
Hide resolved
src/main/java/org/gridsuite/network/map/dto/mapper/VoltageLevelInfosMapper.java
Outdated
Show resolved
Hide resolved
src/main/java/org/gridsuite/network/map/dto/mapper/VoltageLevelInfosMapper.java
Outdated
Show resolved
Hide resolved
|
/** | ||
* @author Slimane Amar <slimane.amar at rte-france.com> | ||
*/ | ||
public class BusbarSectionFinderTraverser implements Terminal.TopologyTraverser { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move those changes in another PR. So the review can be done with #288. And the changes in the tests will be reviewed with it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
} | ||
} | ||
|
||
public static ConnectablePositionInfos toMapConnectablePosition(Identifiable<?> identifiable, int index) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
public static ConnectablePositionInfos toMapConnectablePosition(Identifiable<?> identifiable, int index) { | |
public static ConnectablePositionInfos getConnectablePosition(Identifiable<?> identifiable, ThreeSides side) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with the renaming, but not with changing int index to ThreeSides side, because we need to specify the index to retrieve the feeder
} | ||
|
||
static VoltageLevelMapInfos toMapInfos(Identifiable<?> identifiable) { | ||
private static Map<String, List<FeederBayInfos>> getFeederBaysInfos(VoltageLevel voltageLevel) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
private static Map<String, List<FeederBayInfos>> getFeederBaysInfos(VoltageLevel voltageLevel) {
Map<String, List<FeederBayInfos>> feederBayInfos = new HashMap<>();
voltageLevel.getConnectableStream()
.filter(connectable -> !(connectable instanceof BusbarSection))
.forEach(connectable -> {
List<FeederBayInfos> connections = new ArrayList<>();
connectable.getTerminals().forEach(obj -> {
Terminal terminal = (Terminal) obj;
if (terminal.getVoltageLevel().getId().equals(voltageLevel.getId())) {
connections.add(
new FeederBayInfos(
getBusOrBusbarSection(terminal),
getConnectablePosition(connectable, getConnectableSide(terminal).map(side -> side.getNum()).orElse(0)),
getConnectableSide(terminal).orElse(null)
)
);
}
});
feederBayInfos.put(connectable.getId(), connections);
});
return feederBayInfos;
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
something like this to be more succinct ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
} | ||
} | ||
|
||
private static ConnectablePosition.Feeder getFeederInfos(Identifiable<?> identifiable, int index) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This code should use ThreeSides
private static ConnectablePosition.Feeder getFeederInfos(Identifiable<?> identifiable, int index) { | |
private static ConnectablePosition.Feeder getFeederInfos(Identifiable<?> identifiable, ThreeSides side) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With the index we can handle injections and branches, but the ThreeSides type cannot manage that
return convertFeederToConnectablePositionInfos(feeder); | ||
} | ||
|
||
public static ConnectablePositionInfos convertFeederToConnectablePositionInfos(ConnectablePosition.Feeder feeder) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
public static ConnectablePositionInfos convertFeederToConnectablePositionInfos(ConnectablePosition.Feeder feeder) { | |
public static ConnectablePositionInfos buildConnectablePositionInfos(ConnectablePosition.Feeder feeder) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
final BusbarSectionFinderTraverser connectedBusbarSectionFinder = new BusbarSectionFinderTraverser(terminal.isConnected()); | ||
terminal.traverse(connectedBusbarSectionFinder, TraversalType.BREADTH_FIRST); | ||
return connectedBusbarSectionFinder.getFirstTraversedBbsId(); | ||
// NODE_BREAKER: explore all paths and choose the busbar with the closed disconnector |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move those changes in another PR. So the review can be done with #288. And the changes in the tests will be reviewed with it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
No description provided.